package me.zhengjie.utils.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import me.zhengjie.utils.StringUtils;

@Getter
@AllArgsConstructor
public enum OrderPrefixEnum {

    Exam("NO","测评"),
    Report("RP","测评报告"),
    Group("GR","团体"),
    Course("CR","课程"),
    Meals("ML","课程餐费"),
    Identity("IT","身份产品"),
    Distribution("DI","分销"),
    Chat("CT","AI")

    ;
    private String prefix;
    private String desc;

    public static OrderPrefixEnum getInstance(String orderNo){
        if (StringUtils.isBlank(orderNo)){
            return null;
        }
        for (OrderPrefixEnum value : OrderPrefixEnum.values()) {
            if (orderNo.startsWith(value.prefix)){
                return value;
            }
        }
        return null;
    }
}
